package com.itheima.observer.demo;

/**
 * @author zzw
 * @date 2025/10/25
 * @description 具体观察者类（警察）
 */
public class Policemen implements Observer {
    private String name;

    public Policemen(String name) {
        this.name = name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    @Override
    public void update(Subject subject, Object arg) {
        System.out.println("警察：" + name + " 已经盯你很久了，你可以保持沉默，但你所说的将成为呈堂证供！！！");
    }
}
